package com.sgb.kjwl.view.ui.activity.material;

import android.content.Context;
import android.view.View;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ItemHomeSearchCompanyUpBinding;
import com.sgb.kjwl.model.entity.StoreEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class HomeSearchCompanyUpAdapter extends BaseRecycleAdapter<StoreEntity> {

    public HomeSearchCompanyUpAdapter(Context context, List<StoreEntity> datas) {
        super(context, R.layout.item_home_search_company_up, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final StoreEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        ItemHomeSearchCompanyUpBinding itemSearchCompanyBinding = (ItemHomeSearchCompanyUpBinding) holder.getmBinding();
        if (entity.getAuthYear() == null) {
            holder.getView(R.id.authYear).setVisibility(View.GONE);
        } else {
            holder.getView(R.id.authYear).setVisibility(View.VISIBLE);
        }
        itemSearchCompanyBinding.imageZiying.setVisibility(entity.getSelfSupportTag() == 1 ? View.VISIBLE : View.GONE);
    }
}
